require 'rubygems'
require 'dm-core'
require 'dm-migrations'

class DB
  def DB.Init
    dir_name = "#{Dir.pwd}/db"
    if(!File.exist?(dir_name))
      Dir.mkdir(dir_name) 
    end
    DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/db/mtgox.db")
    DataMapper.finalize
    DataMapper.auto_upgrade!
  end
end
